package com.zr.planclass.controller;

import com.zr.planclass.model.pojo.PlanClass;
import com.zr.planclass.service.BatchImportService;
import com.zr.utils.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName BatchImportController
 * @Description TODO
 * @Author Jiakui_Ma
 * @Date 2019/11/19 16:47
 */
@CrossOrigin
@RestController
@RequestMapping("quotation")
public class BatchImportController {

    @Autowired
    private BatchImportService batchImportService;

    @PostMapping("InquiryIntroduction")
    public ResultUtil fileQuotation(MultipartFile file){
        return batchImportService.importFile(file);
    }
    @GetMapping("material/exportMater")
    public ResultUtil export(HttpServletResponse resp, String code, String name, Boolean status)throws Exception{
        PlanClass planClassSelectVo = new PlanClass();
        planClassSelectVo.setCode(code);
        planClassSelectVo.setName(name);
        planClassSelectVo.setStatus(status);
        return batchImportService.export(resp,planClassSelectVo);

    }

}
